﻿using Caliburn.Micro;

namespace GetMan.Core.Models
{
    public class NodeTreeModel : PropertyChangedBase
    {
        /// <summary>
        /// 节点ID
        /// </summary>
        private long id;
        public long Id
        {
            get => id;
            set
            {
                id = value;
                NotifyOfPropertyChange(() => Id);
            }
        }

        /// <summary>
        /// 节点ID
        /// </summary>
        private long parentId;
        public long ParentId
        {
            get => parentId;
            set
            {
                parentId = value;
                NotifyOfPropertyChange(() => ParentId);
            }
        }
        /// <summary>
        /// 节点名称
        /// </summary>
        private string name;
        public string Name
        {
            get => name;
            set
            {
                name = value;
                NotifyOfPropertyChange(() => Name);
            }
        }

        /// <summary>
        /// 节点名称
        /// </summary>
        private BindableCollection<NodeTreeModel> children;
        public BindableCollection<NodeTreeModel> Children
        {
            get => children;
            set
            {
                children = value;
                NotifyOfPropertyChange(() => Children);
            }
        }

        /// <summary>
        /// 节点类型
        /// </summary>
        private NodeTypeEnum nodeType;
        public NodeTypeEnum NodeType
        {
            get => nodeType;
            set
            {
                nodeType = value;
                NotifyOfPropertyChange(() => NodeType);
            }
        }

        private bool isExpand;
        public bool IsExpand
        {
            get => isExpand;
            set
            {
                isExpand = value;
                NotifyOfPropertyChange(() => IsExpand);
            }
        }
    }

    public enum NodeTypeEnum
    {
        Collection,
        Folder,
        Request
    }
}